package com.ag.common;

import java.sql.Timestamp;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

public class DateUtil {
	public static Date StringToDate(String s){
		SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
		Date currentTime = new Date();
		try {
			currentTime = format.parse(s);
			System.out.println("currentTime="+currentTime);
		} catch (ParseException e) {
			e.printStackTrace();
		}
		return currentTime;
	}
	
	public static String DateToString(Date d){
		SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
		String date = format.format(d);
		return date;
	}
	
}
